package jk.fox.common.exception.runtime;

import jk.fox.common.RpcDict;

/**
 * @author cuichao
 * @Description: RpcRunException
 * @Date: create in 2020/4/20 13:36
 */
public class RpcRunException extends RuntimeException {

    private int code = RpcDict.RpcException.RpcCommonException.getCode();
    private String message;


    public RpcRunException(String message){
        super(message);
        this.message =message;
    }

    public RpcRunException(Throwable throwable){
        super(throwable.getMessage(),throwable);
        this.message =message;
    }

    public RpcRunException(int code, String message){
        super(message);
        this.code = code;
        this.message =message;

    }

    public RpcRunException(int code, Throwable throwable){
        super(throwable.getMessage(),throwable.getCause());
        this.code = code;
        this.message =throwable.getMessage();
    }



    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    /** {@inheritDoc} */
    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
